package Io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class test {

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);

        FileOutputStream fos = new FileOutputStream("note.txt", true);
        while (true){
            String data = sc.nextLine();
            if("exit".equalsIgnoreCase(data)){   //判段输入的值是否是exit
                break;
            }
            fos.write(data.getBytes(StandardCharsets.UTF_8));
        }
        fos.close();
    }
}
